JavaScript Syntax Check | Quick Primer |
These methods are supported using JavaScript syntax.
Calling another procedure
In JavaScript procedures you can also call another JavaScript procedure just by including the procedure name. This also enables XpertRule @command syntax procedures to be invoked (i.e. called from the JavaScript syntax procedure). This is a useful way to utilise the more specialist XpertRule @commands that are not supported by the JavaScript syntax.
Calling an XpertRule procedure and an XpertRule function from a JavaScript procedure...xpertrule.message('Message1','Sample','OK'); #xrProcedure.run(); xpertrule.message('Message3 ' + #xrFunction.run('Fred'),'Sample','OK');XpertRule procedure 'xrProcedure'...
@Alert 'Message2','Sample','OK'XpertRule function 'xrFunction'...
FUNCTION (param1:S):S @SelectCase param1 @Case 'John' @Return 'Manchester' @Case 'Fred' @Return 'London' @EndSelect
Syntax: xpertrule.decodeData(<Message string>);
Syntax: xpertrule.encodeData([#object1, #object2], <include captured objects>, "XML"|"JSON");
Syntax: xpertrule.findObject(<object name>)
Syntax: xpertrule.getValuesToObject([<object id array>])
Syntax: xpertrule.lineOfReasoning()
Syntax: xpertrule.message(<contents>[,<title>]);
Syntax: xpertrule.pause(<passed string data>);
Syntax: xpertrule.phone(<method>,<param array of strings>);
Syntax: xpertrule.phoneFeature(<method>);
Syntax: xpertrule.setValuesWithObject(<xpertrule format javascript object>);
Syntax: xpertrule.urlFetch(<url>[,<post data string>])
Syntax: xpertrule.disableUI(<optional css property object>);
Disable the user interface. This is useful if you are making an asyncronous AJAX call (e.g. urlFetch) and want to prevent the user clicking on any dialog items until the request is complete. The optional css property object contains a collection of css property/value pairs to apply to the disable "shim". Possible uses are making the shim fully transparent or placing a "working" image somewhere via the background-image property.
To disable the UI...xpertrule.disableUI();To make the disable shim have a blue tint...
xpertrule.disableUI( { "background-color": "rgba(0, 0, 255, 0.2)" } );You can style the disable shim by modifying the .xrui-uidisable-shim class in your custom css.
Syntax: xpertrule.enableUI();
Enable the user interface that has previously been disabled via the xpertrule.disableUI() method.
xpertrule.enableUI();
Syntax: hierarchy.clear();
Syntax: hierarchy.toString();